package excerciseSix2;

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		int m=in.nextInt();
		int[] result=new int[m-n];
		int count=0;
		for(int i=n;i<=m;i++){
			if(isTrue(i)){
				result[count]=i;
				count++;
			}
		}
		if(count==0){
			System.out.print("NIL");
		}else{
			for(int i=0;i<count;i++){
				if(i!=count-1){
					System.out.print(result[i]+" ");
				}else{
					System.out.print(result[i]);
				}
			}
		}
		
	}
	public static boolean isTrue(int a) {
		int sum=0;
		int i=1;
		for(i=1;i<a;i++){
			if(a%i==0)sum+=i;
		}
		if(sum==a){
			return true;
		}
		else return false;
	}
}
